Basic search
Lets run a basic search using inverted indexes and ArangoDB
Identity search
Identity search requires the complete content to match
Run the following search
for doc IN wikiVoyage
search doc.title == "San Francisco International Airport"
return docYou should see the following results:
[
{
"_key": "20130659",
"_id": "points-of-interest/20130659",
"_rev": "_giji-7S---",
"alt": "{{IATA|SFO}}",
"article": "San Francisco",
"description": "Located about 10 mi (16 km) south of the city, is the Bay Area's major international airport (and one of the busiest in the nation) and has numerous passenger amenities including a wide range of food and drink establishments, shopping, baggage storage, public showers, a medical clinic, and assistance for lost or stranded travelers and military personnel. SFO has four terminals; as a rule of thumb, Alaska Airlines and American Airlines use Terminal 2, United Airlines has Terminal 3, most other domestic carriers use Terminal 1, and all foreign airlines use the International Terminal. SFO is infamous for its weather delays, so check if Oakland Airport has service from your origin as well. Oakland is closer to Downtown San Francisco than SFO is and fog free.",
"lastEdit": "2019-09-02",
"latitude": 37.618889,
"longitude": -122.375,
"phone": "+1-800-435-9736",
"title": "San Francisco International Airport",
"type": "go",
"url": "https://FlySFO.com",
"wikidata": "Q8688"
}
]If you run the following search instead
for doc IN wikiVoyage
search doc.title == "San Francisco"
return docYour results will be different
[
{
"_key": "20131814",
"_id": "points-of-interest/20131814",
"_rev": "_gijiAAK--h",
"article": "James Bond tourism",
"description": "Featured in ''A View to a Kill'' (1985).",
"directions": "United States",
"latitude": 37.75769,
"longitude": -122.47261,
"title": "San Francisco",
"type": "other"
},
{
"_key": "20133355",
"_id": "points-of-interest/20133355",
"_rev": "_gijhmA2--A",
"article": "Marvel Cinematic Universe",
"description": "The majority of the film takes place here.",
"directions": "California, United States",
"latitude": 37.801944,
"longitude": -122.418889,
"title": "San Francisco",
"type": "other",
"wikidata": "Q62"
},
{
"_key": "20133872",
"_id": "points-of-interest/20133872",
"_rev": "_gijhmIu--C",
"article": "Chocolate",
"description": "A city with a thriving chocolate scene. Home of Ghirardelli Chocolate.",
"image": "Ghirardelli Chocolate Shop Inside, SF, CA, jjron 25.03.2012.jpg",
"lastEdit": "2018-12-06",
"latitude": 37.766667,
"longitude": -122.433333,
"title": "San Francisco",
"type": "maroon",
"wikidata": "Q62"
}
]
The default search is exact search, for the full string with == and is case sensitive
Is recommended to specify the analyzer being used, so that the context is clear to the developer
for doc IN wikiVoyage
search analyzer(doc.title == "San Francisco", "identity")
return doc
Phrase search
- If you need to search for a phrase in the document, you would instead use the following:
for doc IN wikiVoyage
search phrase(doc.title, "San Francisco", "text_en")
return doc - Here is a snippet of the results you should see:
[
{
"_key": "20130050",
"_id": "points-of-interest/20130050",
"_rev": "_giji-Cm-AD",
"address": "114 East Spain Street, Sonoma",
"alt": "Sonoma State Historic Park",
"article": "El Camino Real",
"description": "Founded in 1823 as the last of the Spanish missions, in part by Mariano Vallejo to check the Russian's impact in Northern California. Site of the first vineyard in Sonoma County. This is where American settlers began their uprising against the Mexicans known as the Bear Flag Revolt of 1846. It was bought by the California Historic Landmarks League in 1903 and restored in 1913. Though it was the last mission, it was the third structure in California to be designated a State Historic Landmark",
"hours": "10AM-5PM",
"image": "Mission San Francisco Solano - Sonoma CA USA (12).JPG",
"latitude": 38.294029,
"longitude": -122.455956,
"phone": "+1 707 938-9560",
"title": "Mission San Francisco Solano",
"type": "see",
"url": "http://www.parks.ca.gov/?page_id=479"
},
{
"_key": "20130659",
"_id": "points-of-interest/20130659",
"_rev": "_giji-7S---",
"alt": "{{IATA|SFO}}",
"article": "San Francisco",
"description": "Located about 10 mi (16 km) south of the city, is the Bay Area's major international airport (and one of the busiest in the nation) and has numerous passenger amenities including a wide range of food and drink establishments, shopping, baggage storage, public showers, a medical clinic, and assistance for lost or stranded travelers and military personnel. SFO has four terminals; as a rule of thumb, Alaska Airlines and American Airlines use Terminal 2, United Airlines has Terminal 3, most other domestic carriers use Terminal 1, and all foreign airlines use the International Terminal. SFO is infamous for its weather delays, so check if Oakland Airport has service from your origin as well. Oakland is closer to Downtown San Francisco than SFO is and fog free.",
"lastEdit": "2019-09-02",
"latitude": 37.618889,
"longitude": -122.375,
"phone": "+1-800-435-9736",
"title": "San Francisco International Airport",
"type": "go",
"url": "https://FlySFO.com",
"wikidata": "Q8688"
},
{
"_key": "20130865",
"_id": "points-of-interest/20130865",
"_rev": "_giji_HG--1",
"address": "1 Old Bayshore Highway",
"article": "San Francisco International Airport",
"image": "Millbrae, CA, USA - panoramio.jpg",
"lastEdit": "2019-10-05",
"latitude": 37.603429,
"longitude": -122.376155,
"phone": "+1 650 692-3500",
"title": "The Westin San Francisco Airport",
"type": "sleep",
"url": "https://www.marriott.com/hotels/travel/sfowi-the-westin-san-francisco-airport/"
},
{
"_key": "20130866",
"_id": "points-of-interest/20130866",
"_rev": "_giji_HG-_D",
"address": "401 E Millbrae Ave",
"article": "San Francisco International Airport",
"image": "Aloft San Francisco Airport.jpg",
"lastEdit": "2019-10-05",
"latitude": 37.603164,
"longitude": -122.377678,
"phone": "+1 650 443-5500",
"title": "Aloft San Francisco Airport",
"type": "sleep",
"url": "https://www.marriott.com/hotels/travel/sfoal-aloft-san-francisco-airport/"
},
...
Help us improve
Anything unclear or buggy in this tutorial? Provide Feedback